{% extends "enterprise/base.html" %}

{% block css %}
{% endblock %}
{% block content %}
    <script type="text/javascript">
        var primary_menu = "menu_2";
        var sub_menu = "menu_2_2";
    </script>
            <div class="col-md-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="panel-title"><h3>贮罐区列表</h3></div>
                        <div class="panel-options">
                           <!--  <a href="javascript:;" onclick="allSubmit('/facilities/submitArea/2')" class="bg"><button type="button" class="btn btn-success">全部提交</button></a> -->
                            {% if status != 'finish' %}
                            <a href="/facilities/storageAreaAdd/" class="bg"><button type="button" class="btn btn-success">添加</button></a>
                            {% else %}
                            <a href="javascript:;" class="bg"><button type="button" class="btn btn-success"> 已完成 </button></a>
                            {% endif %}
                            <!--<a href="/facilities/storageAreaMap" class="bg"><button type="button" class="btn btn-success">地图显示</button></a>-->
                            <!-- <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a> -->
                            <!--<a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>-->
                        </div>
                        <!-- <div class="stay_right">
                            <a href="/facilities/productionAdd" class="btn btn-success">添加</a>
                        </div> -->
                    </div>
                    <div class="panel-body with-table">
                        <table class="table table-bordered table-responsive">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>生产区名称</th>
                                <th>描述</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                                {% for sa in sas %}
                                    <tr>
                                        <td>{{ forloop.counter }}</td>
                                        <td>{{ sa.name }}</td>
                                        <td>{{ sa.desc }}</td>
                                        <td>
                                            {% if sa.submit_type == 2 %}
                                                已确认
                                            {% else %}
                                                未确认
                                            {% endif %}
                                        </td>
                                        <td>
                                            <a href="/facilities/storageAreaDetail/{{ sa.id }}" class="btn btn-success">详情</a>
                                            {% if status != 'finish' %}
                                            <a href="/facilities/storageAreaEdit/{{ sa.id }}" class="btn btn-success">修改</a>
                                            <a onclick="beforeDelete('/facilities/storageAreaDel/{{ sa.id }}')" href="javascript:;" class="btn btn-danger">删除</a>
                                            {% endif %}
                                        </td>
                                    </tr>
                                {% empty %}
                                    <tr>
                                        <td colspan=7 style='text-align:center;'>暂无数据</td>
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                        <div class="row">
                            <div class="col-xs-6 col-left">
                                <div class="dataTables_info" id="table-3_info"></div>
                            </div>
                            <div class="col-xs-6 col-right">
                                <div class="dataTables_paginate paging_bootstrap" style="text-align: right;margin-right: 10px">
                                    <ul class="pagination pagination-sm" >
                                        {% if ps.has_previous %}
                                            <li><a href="?page={{ ps.previous_page_number }}">上一页</a></li>
                                        {% else %}
                                            <li class="disabled"> <span>上一页</span></li>
                                        {% endif %}
                                        {% for p in paginator.page_range %}
                                            {% ifequal p ps.number %}
                                                <li class="active"> <span class="p">{{p}}</span></li>
                                            {% else%}
                                                <li> <a href="?page={{ p }}">{{p}}</a></li>
                                            {% endifequal %}
                                        {% endfor %}
                                        {% if ps.has_next %}
                                            <li class="next">  <a href="?page={{ ps.next_page_number }}">下一页</a></li>
                                        {% else %}
                                            <li class="disabled"><span>下一页</span></li>
                                        {% endif %}
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

{% endblock %}

{% block js %}

{% endblock %}